#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define PSQR(x) printf("the square of " #x " is %d.\n", (x)*(x))
#define XNAME(n) x##n
#define PXN(n) printf("x"#n" = %d\n", x##n)
#define PR(...) printf(__VA_ARGS__)
#define MAX_LINE 1024
#define zc_err(fmt, args...) do \
	{ \
		out_put(fmt, ##args); \
	} \
	while(0)


void out_put(const char *fmt, ...)
{
	va_list args;
	va_start(args,fmt);
	vprintf(fmt, args);
	va_end(args);
}


int main(int argc, char **argv)
{
#if defined __GNUC__
	printf("%d\n", __GNUC__);
#endif

	int y = 4;
	PSQR(y);
	PSQR(2+4);

	int XNAME(1) = 12;
	PXN(1);
	PR("HELLO\n");
	PR("D:%d A:%d\n", 1, 2);
	zc_err("%d %d\n", 1, 2);

	char line[1024] = {'a','b', 'd', 'e'};
	char *pline = NULL;
	pline = line;
	memset(&line, 0x00, sizeof(line));
	int i=0;
	for(i=0;i<4;i++)
		printf("char:%c\n", line[i]);

	memset(line, 0x00, sizeof(line));
	for(i=0;i<4;i++)
		printf("char:%c\n", line[i]);

	printf("sizeof(line):%d\n", sizeof(line));
	printf("pline - line: %d\n", pline-line);
	size_t len = sizeof(line) - (pline-line);
	printf("len: %d\n", len);




	return 0;
}
